from openai import OpenAI as ai

#ai.api_key = "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"

"""
def chat(prompt):
    response = ai.ChatCompletion.create(
        model="gpt-3.5-turbo",
        messages=[
            {"role": "user", "content": prompt}
        ]
    )
    return response['choices'][0]['message']['content']

result = chat(input("Enter a prompt:"))
print(result)
"""

client = ai(
    api_key="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"  # 替换为你的 API 密钥
)

response = client.chat.completions.create(
    messages=[
        {'role': 'user', 'content': "1+1等于几？帮我说列出详细步骤。"},
    ],
    model='gpt-3.5-turbo',  # 使用的模型
    stream=False  # 是否启用流式返回
)

print(response.choices[0].message.content)